package TwentyOne.Class.Jc;

/*
 * 人类：姓名、地址、性别、年龄；
 * 一个4参构造方法、一个两参构造方法、一个无参构造方法、一个输出方法显示4种属性。
 * 
 * 学生：继承人类，添加数学成绩和英语成绩
 * 一个6参构造方法、一个两参构造方法、一个无参构造方法和重写输出方法用于显示6种属性。
 */
class Person {

    private String name;
    private String addr;
    private char sex;
    private int age;

    public Person() {
    }

    public Person(String name, String addr) {
        this(name, addr, '男', 0);
    }

    public Person(String name, String addr, char sex, int age) {
        this.name = name;
        this.addr = addr;
        this.sex = sex;
        this.age = age;
    }

    public String getInfo() {
        return "姓名：" + this.name + "、地址：" + this.addr + "、性别：" + this.sex + "、年龄：" + this.age;
    }
}

class Student extends Person {

    private double math;
    private double english;

    public Student() {
    }

    public Student(String name, String addr) {
        super(name, addr);
    }

    public Student(String name, String addr, char sex, int age, double math, double english) {
        super(name, addr, sex, age);
        this.math = math;
        this.english = english;
    }

    public String getInfo() {
        return super.getInfo() + "、数学成绩：" + this.math + "、英语成绩：" + this.english;
    }

}

public class a13_Student {

    public static void main(String[] args) {
        Student stu = new Student("张三", "天安门", '男', 12, 78.93, 89.54);
        System.out.println(stu.getInfo());
    }
}
